home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / mus / play / tracker_4_31.lzh / tracker / song.h < prev    next >
C/C++ Source or Header  |  1995-03-03  |  4KB  |  170 lines

  1. /* song.h 
  2.     vi:ts=3 sw=3:
  3.  */
  4.  
  5. /* internal data structures for the soundtracker player routine....
  6.  */
  7.  
  8. /* $Id: song.h,v 4.13 1995/03/04 00:16:16 espie Exp espie $
  9.  * $Log: song.h,v $
  10.  * Revision 4.13  1995/03/04  00:16:16  espie
  11.  * *** empty log message ***
  12.  *
  13.  * Revision 4.12  1995/03/01  15:24:51  espie
  14.  * Minor changes.
  15.  *
  16.  * Revision 4.11  1995/02/21  17:54:32  espie
  17.  * Internal problem: buggy RCS. Fixed logs.
  18.  *
  19.  * Revision 4.8  1995/02/20  16:49:58  espie
  20.  * Added song type (protracker or old st) for further checks.
  21.  *
  22.  * Revision 4.6  1995/02/06  14:50:47  espie
  23.  * Changed sample_info.
  24.  *
  25.  * Revision 4.5  1995/02/01  17:14:54  espie
  26.  * Scaled volume.
  27.  *
  28.  * Revision 4.0  1994/01/11  17:55:59  espie
  29.  * REAL_MAX_PITCH for better player.
  30.  * REAL_MAX_PITCH != MAX_PITCH.
  31.  * Added samples_start.
  32.  *
  33.  * Revision 2.5  1992/10/31  11:18:00  espie
  34.  * New fields for optimized resampling.
  35.  * Exchanged __ANSI__ to SIGNED #define.
  36.  */
  37.  
  38. #ifdef SIGNED
  39. typedef signed char SAMPLE;
  40. #else
  41. typedef char SAMPLE;
  42. #endif
  43.  
  44.  
  45. #define MAX_NUMBER_SAMPLES 32
  46. #define ST_NUMBER_SAMPLES 15
  47. #define PRO_NUMBER_SAMPLES 31
  48.  
  49. #define NORMAL_PLENGTH 64
  50. #define NORMAL_NTRACKS 4
  51. #define MAX_TRACKS 8
  52. #define NUMBER_SAMPLES 32
  53.  
  54. #define BLOCK_LENGTH 64
  55. #define NUMBER_TRACKS 4
  56. #define NUMBER_PATTERNS 128
  57.  
  58. #define NUMBER_EFFECTS 40
  59.  
  60. /* some effects names */
  61. #define EFF_ARPEGGIO    0
  62. #define EFF_DOWN        1
  63. #define EFF_UP          2
  64. #define EFF_PORTA       3
  65. #define EFF_VIBRATO     4
  66. #define EFF_PORTASLIDE  5
  67. #define EFF_VIBSLIDE    6
  68. #define EFF_TREMOLO        7
  69. #define EFF_OFFSET      9
  70. #define EFF_VOLSLIDE    10
  71. #define EFF_FF          11
  72. #define EFF_VOLUME      12
  73. #define EFF_SKIP        13
  74. #define EFF_EXTENDED    14
  75. #define EFF_SPEED       15
  76. #define EFF_NONE        16
  77. #define EXT_BASE        16
  78. #define EFF_SMOOTH_UP   (EXT_BASE + 1)
  79. #define EFF_SMOOTH_DOWN (EXT_BASE + 2)
  80. #define EFF_GLISS_CTRL    (EXT_BASE + 3)
  81. #define EFF_VIBRATO_WAVE    (EXT_BASE + 4)
  82. #define EFF_CHG_FTUNE   (EXT_BASE + 5)
  83. #define EFF_LOOP        (EXT_BASE + 6)
  84. #define EFF_TREMOLO_WAVE    (EXT_BASE + 7)
  85. #define EFF_RETRIG      (EXT_BASE + 9)
  86. #define EFF_S_UPVOL     (EXT_BASE + 10)
  87. #define EFF_S_DOWNVOL   (EXT_BASE + 11)
  88. #define EFF_NOTECUT     (EXT_BASE + 12)
  89. #define EFF_LATESTART   (EXT_BASE + 13)
  90. #define EFF_DELAY       (EXT_BASE + 14)
  91. #define EFF_INVERT_LOOP    (EXT_BASE + 15)
  92.  
  93. #define SAMPLENAME_MAXLENGTH 22
  94. #define TITLE_MAXLENGTH 20
  95.  
  96. #define MIN_PITCH 113
  97. #define MAX_PITCH 856
  98. #define REAL_MAX_PITCH 1050
  99.  
  100. #define MIN_VOLUME 0
  101. #define MAX_VOLUME 64
  102.  
  103. /* the fuzz in note pitch */
  104. #define FUZZ 2
  105.  
  106. /* we refuse to allocate more than 500000 bytes for one sample */
  107. #define MAX_SAMPLE_LENGTH 500000
  108.  
  109. struct sample_info
  110.    {
  111.    char *name;
  112.    int  length, rp_offset, rp_length;
  113.    unsigned long  fix_length, fix_rp_length;
  114.    int volume;
  115.     int volume_lookup[MAX_VOLUME+1];
  116.     int color;
  117.     int sample_size;            /* 8 or 16 */
  118.    int finetune;
  119.    SAMPLE *start, *rp_start;
  120.    };
  121.  
  122. /* the actual parameters may be split in two halves occasionnally */
  123.  
  124. #define LOW(para) ((para) & 15)
  125. #define HI(para) ((para) >> 4)
  126.  
  127. struct event
  128.    {
  129.    unsigned char sample_number;
  130.    unsigned char effect;
  131.    unsigned char parameters;
  132.    unsigned char note;
  133.    int pitch;
  134.    };
  135.  
  136. struct block
  137.    {
  138.    struct event *e[MAX_TRACKS];
  139.    };
  140.     
  141.         
  142. struct song_info
  143.    {
  144.    int length;
  145.    int maxpat;
  146.    int transpose;
  147.     int plength;
  148.    char patnumber[NUMBER_PATTERNS];
  149.    struct block *pblocks;
  150.    };
  151.  
  152. #define OLD_ST 0
  153. #define PROTRACKER 1
  154.  
  155. struct song
  156.    {
  157.    char *title;
  158.       /* sample 0 is always a dummy sample */
  159.    struct sample_info *samples[MAX_NUMBER_SAMPLES];
  160.     int type;
  161.     int ntracks;
  162.     int ninstr;
  163.     int side_width;
  164.     int max_sample_width;            
  165.    struct song_info info;
  166.    long samples_start;
  167.    };
  168.  
  169. #define AMIGA_CLOCKFREQ 3575872
  170.